package cn.mntool.backup.utils;

import java.io.File;
import java.io.FileNotFoundException;
import java.net.URISyntaxException;

/**
 * describe: 文件路径工具
 *
 * @author lianying
 * @date 2018/11/14
 */
public class PathUtils {
    private PathUtils(){}
    /**
     * 获取classPath目录绝对路径
     *
     * @return
     * @throws FileNotFoundException
     */
    public static String classPath(){
        //获取跟目录
        File path = null;
        try {
            path = new File(PathUtils.class.getResource("/").toURI());
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }
        if (!path.exists()) {
            path = new File("");
        }
        return path.getAbsolutePath()+"/";
    }
}
